<?php
/** @var TareaEtapaController $this */
/** @var TareaEtapa $model */
/** @var AweActiveForm $form */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'tarea-etapa-form',
    'enableAjaxValidation' => false,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => true,
        ));
?>

<p class="note"><?php echo Yii::t('AweCrud.app', 'Fields with') ?> <span class="required">*</span> <?php echo Yii::t('AweCrud.app', 'are required') ?>.</p>

<?php echo $form->textFieldRow($model, 'nombre', array('maxlength' => 64, 'class' => 'span6')) ?>
<?php // echo $form->textFieldRow($model, 'porcentaje', array('class' => 'span3')) ?>
<div class="control-group">
    <label class="control-label" for="TareaEtapa_porcentaje" ><?php echo $form->labelEx($model, 'porcentaje') ?></label>
    <div class="controls">
        <div class="controls controls-row">
            <input type="text" id="amount_animate" style="border:0; color:#f6931f; font-weight:bold;"/> 
        </div>
        <div class="controls-control">
            <?php
            $this->widget('zii.widgets.jui.CJuiSliderInput', array(
                'name' => 'slider_animate',
                'model' => $model,
                'attribute' => 'porcentaje',
                'value' => 0, // default selection
                'event' => 'change',
                'options' => array(
                    'min' => 0, //minimum value for slider input
                    'max' => 100, // maximum value for slider input
                    //step: 50,
                    'step' => 5,
                    'animate' => true,
                    // on slider change event
                    'slide' => 'js:function(event,ui){$("#amount_animate").val(ui.value+"%");}',
                ),
                // slider css options
                'htmlOptions' => array(
                    'style' => 'width:200px;background-color:red;',
                ),
            ));
            ?>  
        </div>
    </div>
</div>
<div class="form-actions">
    <div class="form-actions-float">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'success',
            'icon' => 'ok',
            'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        ));
        ?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'icon' => 'remove',
            'label' => Yii::t('AweCrud.app', 'Cancel'),
            'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
        ));
        ?>
    </div>
</div>
<?php $this->endWidget(); ?>
